var a = {}
a.name="123"
a.study = function(){
     console.log("study")
}
// console.log(a)
var b = {
    name:"234",
    age:18,
    study:function(){
        console.log("566")
    }
}
// console.log(b)
    //工厂模式
    function Person(name,age,gender){
        var obj={};
        obj.name = name;
        obj.age = age;
        obj.gender = gender;
        obj.study = function(){
            console.log("study")
        }
        return obj ;
    }
    var li = Person("123",18,"nv")
    // console.log(li)
    //2.构造函数式
    function Person2(n,a,g){
        this.name = n 
        this.age = a
        this.gender = g
        // this.study = function(){
        //     console.log("abc")
        // }
    }
    Person2.prototype.study = function(){
        console.log("aaa")
    }
    var wang = new Person2("wang",19,"nv")
    console.log(wang.study())

